package com.ruoyi.oar.controller.sys;

import com.ruoyi.common.core.controller.BaseController;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 内外网同步Controller
 *
 * @author oar
 * @date 2022-02-24
 */
@Api(tags = "内外网同步")
@RestController
@RequestMapping("/sys/oar-syncs")
public class OarSyncController extends BaseController {
    //@Autowired
    //private OarSyncService oarSyncService;

    ///**
    // * 查询内外网同步列表
    // */
    //@ApiOperation("查询内外网同步列表")
    //@PreAuthorize("@ss.hasRole('admin')")
    //@GetMapping
    //public TableDataInfo<OarSyncDTO> list(OarSyncQuery oarSyncQuery) {
    //    logger.debug("查询内外网同步列表,查询条件oarSyncQuery={}", JSONObject.toJSONString(oarSyncQuery));
    //    startPage();
    //    return oarSyncService.findAll(oarSyncQuery);
    //}
    ///**
    // * 删除内外网同步
    // */
    //@ApiOperation("删除内外网同步")
    //@PreAuthorize("@ss.hasPermi('oar:sync:remove')")
    //@Log(title = "内外网同步", businessType = BusinessType.DELETE)
    //@DeleteMapping("/{syncIds}")
    //public AjaxResult remove(@PathVariable Long[] syncIds) {
    //    logger.debug("删除内外网同步,syncIds={}",JSONObject.toJSONString(syncIds));
    //    Arrays.asList(syncIds).forEach(this::checkSyncId);
    //    return toAjax(oarSyncService.deleteOarSyncBySyncIds(syncIds));
    //}

    ///**
    // * 校验
    // *
    // * @param syncId
    // */
    //private void checkSyncId(Long syncId) {
    //    Optional.ofNullable(syncId).orElseThrow(() -> new ServiceException("ID不能为空"));
    //    oarSyncService.selectOarSyncBySyncId(syncId).orElseThrow(() -> new ServiceException("无效的ID"));
    //}
}
